<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('内容管理系统')" />
	<th:block th:include="include :: layout-latest-css" />
	<th:block th:include="include :: ztree-css" />
	<link th:href="@{/css/cms/cms.css}" rel="stylesheet"/>
</head>
<body class="gray-bg" th:classappend="|${@config.getKey('sys.index.sideTheme')} ${@config.getKey('sys.index.skinName')}|">

	<div class="ui-layout-north hide">
		<div class="col-md-10 navbar navbar-static-top">
			<div class="cms-app-name">内容管理系统</div>
		</div>
		<div class="col-md-2" style="padding-left: 0;padding-right: 0;">
			<nav class="navbar bootsnav">
	            <div class="navbar collapse navbar-collapse navbar-static-top">
	                <ul class="nav navbar-nav" data-in="fadeInDown" data-out="fadeOutUp" style="float: right;">
	                   	<li class="">
	                   		<a href="javascript:;" class="menuItem">
							<img th:src="(${user.avatar == null || user.avatar == ''}) 
								? @{/img/profile.png} 
								: '/easyfile/view/' + @{${user.avatar}}" class="user-image">
							<span class="hidden-xs">[[${user.userName}]]</span>
							</a>
	                   </li>
	                   <li>
	                   		<a title="退出登录" th:href="@{/logout}" class="menuItem"><i class="fa fa-sign-out fa-fw"></i> </a>
	                   </li>
					</ul>
				</div>
			</nav>
        </div>
	</div>
	
	<div class="ui-layout-west">
		<div class="box box-main">
			<div class="box-header">
				<div class="box-title">
					<i class="fa icon-grid"></i>站点栏目
				</div>
				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
					<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
					<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新部门"><i class="fa fa-refresh"></i></button>
				</div>
			</div>
			<div class="ui-layout-content">
				<div id="tree" class="ztree"></div>
			</div>
		</div>
	</div>
	
	<div class="ui-layout-center" id="ui-cms-content">
		
	</div>
	
	<!-- 操作栏 -->
	<div class="ui-layout-east">
		<div class="ui-cms-toolbar" id="ui-cms-toolbar">
			
		</div>
	</div>
	
	<div class="ui-cms-sidebar">
		<ul>
			<li>
				<div class="cms-sidebar-item">
					<span onclick="channel()">模板配置</span>
				</div>
			</li>
			<li>
				<div class="cms-sidebar-item" id="site-channel-config">
					<span onclick="siteChannelConfig()">站点配置</span>
				</div>
			</li>
		</ul>
	</div>
	
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: layout-latest-js" />
	<th:block th:include="include :: ztree-js" />
	<th:block th:include="cms/include :: cms-index" />
	
</body>
<!-- 表格操作列 -->
<script id="operateTpl" type="text/template">
<tmpl>
	<a onclick="$.operate.add('${id}')" shiro:hasPermission="cms:channel:add" class="btn btn-primary btn-xs">
		<i class="fa fa-plus"></i> 新增
	</a>
	<a onclick="$.operate.edit('${id}')" shiro:hasPermission="cms:channel:edit" class="btn btn-primary btn-xs">
		<i class="fa fa-edit"></i> 修改
	</a>
	<a onclick="$.operate.remove('${id}')" shiro:hasPermission="cms:channel:remove" class="btn btn-danger btn-xs">
		<i class="fa fa-trash"></i> 删除
	</a> 
</tmpl>
</script>

<!-- 稿件中心区域 -->
<script id="documentContainerTpl" type="text/template">
<tmpl>
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="user-form">
					<input type="hidden" id="channelId" name="channelId">
	                <input type="hidden" id="parentId" name="parentId">
					<div class="select-list">
						<ul>
							<li>
								文档标题：<input type="text" name="title" placeholder="请输入文档标题"/>
							</li>
							<li>
								副标题：<input type="text" name="subtitle" placeholder="请输入副标题"/>
							</li>
							<li>
								作者：<input type="text" name="docAuthor" placeholder="请输入作者"/>
							</li>
							<li>
								稿件状态：<select name="status" th:with="type=${@dict.getDict('sys_data_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictName}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li class="select-time">
								<label>创增时间： </label>
								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="query[startTime]"/>
								<span>-</span>
								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="query[endTime]"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-default btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
	        	<a class="btn btn-primary" onclick="$.operate.addTab()" shiro:hasPermission="cms:document:add">
	                <i class="fa fa-plus"></i> 新增
	            </a>
	             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="cms:document:edit">
		            <i class="fa fa-edit"></i> 修改
		        </a>
	            <a class="btn btn-primary multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="cms:document:remove">
	                <i class="fa fa-trash"></i> 删除
	            </a>
	            <a class="btn btn-primary" onclick="$.table.importExcel()" shiro:hasPermission="cms:document:import">
		            <i class="fa fa-upload"></i> 导入
		        </a>
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
</tmpl>
</script>

<!-- 栏目中心区域 -->
<script id="channelContainerTpl" type="text/template">
<tmpl>
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="dept-form">
					<input type="hidden" id="siteId" name="siteId">
					<div class="select-list">
						<ul>
							<li>
								栏目名称：<input type="text" name="channelName" placeholder="请输入栏目名称"/>
							</li>
							<li>
								栏目状态：<select name="status" th:with="type=${@dict.getDict('sys_data_status')}">
									<option value="">所有</option>
									<option th:each="dict : ${type}" th:text="${dict.dictName}" th:value="${dict.dictValue}"></option>
								</select>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-default btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
                
            <div class="btn-group-sm" id="toolbar" role="group">
		        <a class="btn btn-primary" onclick="$.operate.add('root')" shiro:hasPermission="cms:channel:add">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="cms:channel:edit">
		            <i class="fa fa-edit"></i> 修改
		        </a>
                <a class="btn btn-primary" onclick="$.operate.expandAllBtn()">
                    <i class="fa fa-exchange"></i> 展开/折叠
                </a>
	        </div>
       		 <div class="col-sm-12 select-table table-striped">
	            <table id="bootstrap-tree-table"></table>
	        </div>
	    </div>
	</div>
</tmpl>
</script>
<!-- 站点类型操作 -->
<script id="siteOperateTpl" type="text/template">
<tmpl>
	<div class="panel panel-default">
		<div class="panel-heading">站点操作</div>
		<div class="panel-body">
			<ul>
				<li><a onclick="$.modal.open('修改站点', '/cms/channel/edit/${id}')"><i class="fa fa-edit"> </i> 修改这个站点</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-search"> </i> 预览这个站点</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-internet-explorer"> </i> 发布这个站点</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-file-excel-o"> </i> 导出这个站点</a></li>
			</ul>
		</div>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">站点栏目操作</div>
		<div class="panel-body">
			<ul>
				<li><a onclick="$.modal.open('新增栏目', '/cms/channel/add/${id}')"><i class="fa fa-plus"> </i> 新增一个栏目</a></li>
				<li><a onclick="batchChannel()"><i class="fa fa-tree"> </i> 批量新增栏目</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-external-link"> </i> 导入栏目</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-file-excel-o"> </i> 导出栏目</a></li>
			</ul>
		</div>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">站点基本信息</div>
		<div class="panel-body">
			<p data-toggle="tooltip" data-placement="top" title="${channelName}"><strong>${channelName}</strong></p>
			<p data-toggle="tooltip" data-placement="top" title="index.html">首页模板：index.html</p>
			<p data-toggle="tooltip" data-placement="top" title="http://127.0.0.1:8081">站点网址：<a href="#" target="_blank">http://127.0.0.1:8081</a></p>
			<p data-toggle="tooltip" data-placement="top">发布位置：/site/public/</p>
			<p data-toggle="tooltip" data-placement="top">创建人：${createBy}</p>
			<p data-toggle="tooltip" data-placement="top">创建时间：${createTime}</p>
		</div>
	</div>
</tmpl>
</script>

<!-- 栏目类型操作 -->
<script id="channelOperateTpl" type="text/template">
<tmpl>
	<div class="panel panel-default">
		<div class="panel-heading">栏目操作</div>
		<div class="panel-body">
			<ul>
				<li><a onclick="$.modal.open('修改栏目', '/cms/channel/edit/${id}')"><i class="fa fa-edit"> </i> 修改这个栏目</a></li>
				<li><a onclick="$.modal.open('新增栏目', '/cms/channel/add/${id}')"><i class="fa fa-plus"> </i> 新增一个栏目</a></li>
				<li><a onclick="batchChannel()"><i class="fa fa-tree"> </i> 批量新增栏目</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-search"> </i> 预览这个栏目</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-internet-explorer"> </i> 发布这个栏目</a></li>
			</ul>
		</div>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">栏目稿件操作</div>
		<div class="panel-body">
			<ul>
				<li><a onclick="$.modal.openTab('新增稿件','/cms/document/add/${id}')"><i class="fa fa-plus"> </i> 新增一篇稿件</a></li>
				<li class="single hide"><a onclick="editDocument()"><i class="fa fa-edit"> </i> 修改这篇稿件</a></li>
				<li class="single hide"><a onclick="editDocument()"><i class="fa fa-folder-o"> </i> 移动这篇稿件</a></li>
				<li class="single hide"><a href=onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-search"> </i> 预览这篇稿件</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-file-word-o"> </i> 导入一篇稿件</a></li>
                <li class="multiple hide"><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-internet-explorer"> </i> 发布选中稿件</a></li>
                <li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-joomla"> </i> 发布所有稿件</a></li>
				<li class="multiple hide"><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-check-square-o"> </i> 导出选中稿件</a></li>
				<li><a onclick="$.modal.alertWarning('敬请期待')"><i class="fa fa-file-excel-o"> </i> 导出所有稿件</a></li>
			</ul>
		</div>
	</div>
	<div class="panel panel-default">
		<div class="panel-heading">栏目基本信息</div>
		<div class="panel-body">
			<p data-toggle="tooltip" data-placement="top"><strong>今日新闻</strong></p>
			<p data-toggle="tooltip" data-placement="top" title="index.html">首页模板：index.html</p>
			<p data-toggle="tooltip" data-placement="top" title="http://127.0.0.1:8081/channel">栏目网址：<a href="#" target="_blank">http://127.0.0.1:8081</a></p>
			<p data-toggle="tooltip" data-placement="top">发布位置：/site/public/</p>
			<p data-toggle="tooltip" data-placement="top">其它信息：测试站点</p>
		</div>
	</div>
</tmpl>
</script>
</html>